package com.beerandjesus.sportofkings.handicapper.factory.brisnet.singlefile;

import com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.PerformanceRecord;
import com.beerandjesus.sportofkings.handicapper.model.brisnet.singlefile.PerformanceRecordImpl;

public class PerformanceRecordFactoryImpl extends AbstractObjectFactoryImpl implements PerformanceRecordFactory {

	/* (non-Javadoc)
	 * @see com.beerandjesus.sportofkings.handicapper.factory.brisnet.singlefile.PerformanceRecordFactory#getPerformanceRecord(java.lang.String)
	 */
	public PerformanceRecord getPerformanceRecord(String line) {
		String[] values = getValues(line);
		
		return getPerformanceRecord(values);
		
	}

	public PerformanceRecord getPerformanceRecord(String[] values) {
		PerformanceRecordImpl r = new PerformanceRecordImpl();
		r.setThisDistanceStarts(val(values,65));
		r.setThisDistanceWins(val(values,66));
		r.setThisDistancePlaces(val(values,67));
		r.setThisDistanceShows(val(values,68));
		r.setThisDistanceEarnings(val(values,69));
		r.setThisTrackStarts(val(values,70));
		r.setThisTrackWins(val(values,71));
		r.setThisTrackPlaces(val(values,72));
		r.setThisTrackShows(val(values,73));
		r.setThisTrackEarnings(val(values,74));
		r.setTurfStarts(val(values,75));
		r.setTurfWins(val(values,76));
		r.setTurfPlaces(val(values,77));
		r.setTurfShows(val(values,78));
		r.setTurfEarnings(val(values,79));
		r.setWetStarts(val(values,80));
		r.setWetWins(val(values,81));
		r.setWetPlaces(val(values,82));
		r.setWetShows(val(values,83));
		r.setWetEarnings(val(values,84));
		r.setCurrentYearYear(val(values,85));
		r.setCurrentYearStarts(val(values,86));
		r.setCurrentYearWins(val(values,87));
		r.setCurrentYearPlaces(val(values,88));
		r.setCurrentYearShows(val(values,89));
		r.setCurrentYearEarnings(val(values,90));
		r.setPrevYearYear(val(values,91));
		r.setPrevYearStarts(val(values,92));
		r.setPrevYearWins(val(values,93));
		r.setPrevYearPlaces(val(values,94));
		r.setPrevYearShows(val(values,95));
		r.setPrevYearEarnings(val(values,96));
		r.setLifetimeStarts(val(values,97));
		r.setLifetimeWins(val(values,98));
		r.setLifetimePlaces(val(values,99));
		r.setLifetimeShows(val(values,100));
		r.setLifetimeEarnings(val(values,101));
		
		return r;
	}

}
